#include <iostream>
#include "fsm.h"
using namespace std;
using namespace fsm;
int action( int argc , char ** argv ){
	printf("i am in %c\n" , argc );
	return argc;
}

int main(void){
	CFsmStat * statStart = BuildCFsmStat( 's' , action , '1' , '2' , '3' , -1 );
	CFsmStat * stat2 = BuildCFsmStat( '1' , action , '2' , 'e' , -1 );
	CFsmStat * stat3 = BuildCFsmStat( '2' , action , '3' , -1 );
	CFsmStat * stat4 = BuildCFsmStat( '3' , action , 'e' , -1 );
	CFsmStat * statFinish = BuildCFsmStat( 'e' , action , -1 );

	CFsm * fsm_p = BuildCFsm( 's' , 'e' , statStart , stat2 , stat3 , stat4, statFinish , NULL);
	fsm_p->trigger( "1" );
	fsm_p->trigger( "2" );
	fsm_p->trigger( "3" );
	fsm_p->trigger( "e" );
	
	return 0 ;
}
